/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - StuTest
 * <p>Powered by webrx On 2021-12-28 09:39:22
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class StuTest {
    static record Stu(int id, String name) {
    }


    public static void main(String[] args) {
        //record
        var stu = new Stu(10, "张三");
        System.out.println(stu.id());
        System.out.println(stu.name());
        System.out.println(stu);


        //record
        var st = new Student(10, "李四", 18);
        System.out.println(st);
        System.out.println(st.name());
        System.out.println(st.pf(3));
        System.out.println(Student.AGE);

        var st2 = new Student(33);
        System.out.println(st2);

        //自己编写的
        var u = new User(11, "admin", 22);
        System.out.println(u);
        System.out.println(u.getName());

        //lombok组件
        var book = new Book();
        book.setId(10);
        book.setName("《java基础入门》");
        book.setPrice(20.0D);
        book.setDescription("java 初学入门教程");


    }
}
